package com.atguigu.condition;

import com.atguigu.bean.Yellow;
import org.springframework.context.annotation.ImportSelector;
import org.springframework.core.type.AnnotationMetadata;

//自定义逻辑返回需要导入的组件
public class MyImportSelector implements ImportSelector {


    /***
     *
     * @param importingClassMetadata:当前标注@Import注解的类的所有注解信息
     * @return  返回值就是要导入到容器中组件的全类名
     */
    @Override
    public String[] selectImports(AnnotationMetadata importingClassMetadata) {

        //importingClassMetadata.get

        //方法不要返回null值
        return new String[]{"com.atguigu.bean.Blue","com.atguigu.bean.Yellow"};
    }
}
